//
//  TechnologyStatisticsViewCell.m
//  LiveSoftware
//
//  Created by lanou3g on 15/7/15.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "TechnologyStatisticsViewCell.h"
#import "DetailTechnologyStatisticsModel.h"

@interface TechnologyStatisticsViewCell ()

@property(nonatomic,strong)UILabel *homeLabel;
@property(nonatomic,strong)UILabel *eventLabel;
@property(nonatomic,strong)UILabel *awayLabel;

@end


@implementation TechnologyStatisticsViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
    {
        CGFloat height = 35;
        
        //主队
        self.homeLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, kScreenIp6(40), height)];
        self.homeLabel.center = CGPointMake(kScreenWidth / 4, height/2);
        
        self.homeLabel.font = [UIFont systemFontOfSize:14];
        self.homeLabel.textAlignment = NSTextAlignmentCenter;
        
        [self.contentView addSubview:_homeLabel];
        
        //事件
        self.eventLabel = [[UILabel alloc]initWithFrame:CGRectMake((kScreenWidth - kScreenIp6(100)) / 2, 0, kScreenIp6(100), height)];
        
        self.eventLabel.font = [UIFont systemFontOfSize:14];
        self.eventLabel.textAlignment = NSTextAlignmentCenter;
        
        [self.contentView addSubview:_eventLabel];
        
        //客队
        self.awayLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, 0, kScreenIp6(40), height)];
        self.awayLabel.center = CGPointMake(kScreenWidth*3/4, height/2);
        
        self.awayLabel.font = [UIFont systemFontOfSize:14];
        self.awayLabel.textAlignment = NSTextAlignmentCenter;
        [self.contentView addSubview:_awayLabel];
        
        
        //线
        UIView *footLineView = [[UIView  alloc]initWithFrame:CGRectMake( 0, height, kScreenWidth, 0.5)];
        
        footLineView.backgroundColor = [UIColor colorWithWhite:0.699 alpha:1.000];
        
        [self.contentView addSubview:footLineView];
        
        
        // 设置 cell 点击没有变化
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
    }
    
    return self;
}



-(void)setCellValue:(DetailTechnologyStatisticsModel*)model
{
    
    switch ([model.eventType intValue]) {
        case 0://先开球
            self.eventLabel.text = @"先开球";
            break;
            
        case 2://第一张黄牌
            self.eventLabel.text = @"第一张黄牌";
            break;
            
            
            
        case 3://射门次数
            self.eventLabel.text = @"射门次数";
            break;
            
            
            
        case 4:// 射正次数
            self.eventLabel.text = @"射正次数";
            break;
            
            
        case 5:// 犯规次数
            self.eventLabel.text = @"犯规次数";
            break;
            
            
            
        case 6:// 角球次数
            self.eventLabel.text = @"角球次数";
            break;
            
            
        case 8:// 任意球次数
            self.eventLabel.text = @"任意球次数";
            break;
            
            
            
        case 9://越位次数
            
            self.eventLabel.text = @"越位次数";
            break;
            
            
        case 11://黄牌
            self.eventLabel.text = @"黄牌";
            break;
            
            
            
        case 13://红牌
            self.eventLabel.text = @"红牌";
            break;
            
            
        case 14://控球时间
            
            self.eventLabel.text = @"控球时间";
            break;
            
            
        case 15://头球
            
            self.eventLabel.text = @"头球";
            break;
            
            
        case 16://救球
            self.eventLabel.text = @"救球";
            break;
            
           
            
        case 25://第一个换人
            
            self.eventLabel.text = @"第一个换人";
            break;
            
            
        case 26://最后换人
            self.eventLabel.text = @"最后换人";
            break;
            
            
        case 29://换人数
            
            self.eventLabel.text = @"换人数";
            break;
            
            
        case 31://最后黄牌
            self.eventLabel.text = @"最后黄牌";
            break;
            
            
            
        default:
            break;
    }
    
    self.homeLabel.text = model.homeEventTime;
    self.awayLabel.text = model.awayEventTime;
    
    
}


@end
